<#include "/include/tag.ftl">
<#import "/macro/articleTemplate.ftl" as art>
<html lang="en">
<head>
	<title>Share Advance</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<#include "/include/common.ftl">
</head>

<body class="home">
	<#include "/template/header.ftl">
	<div id="content-wrapper">
		<header class="secondary head"></header>
		<!-- container -->
		<div class="container">
		
			<ol class="breadcrumb">
				<li><a href="${ctx}/index">首页</a></li>
				<li class="active">文章</li>
			</ol>
		
			<div class="row">
				<div class="col-sm-9 maincontent">
					<#if articlesList?exists && articlesList?size gt 0>
						<#list articlesList as article>
							<@art.article id="${article.articleId}" title="${article.title}" url="${ctx}/article/getArticleDetial?id=${article.articleId}">
								<div class="post-meta">
									<span class="date">${article.releaseDate?string("yyyy-MM-dd HH:mm:ss")}</span>
									<span class="author">${article.username}</span>
									<span class="comments"><a href="${ctx}/article/getArticleDetial?id=${article.articleId}#comment_anchor" >${article.commentNum} 评论</a></span>
									<span class="like-count">${article.praise}</span>
								</div>
								<p>
									<#if article.description?exists && article.description !=''>
										${article.description}...<a class="readmore-link" href="${ctx}/article/getArticleDetial?id=${article.articleId}">阅读</a>
									</#if>
								</p>
							</@art.article>
						</#list>
					</#if>
					<!-- pagination -->
					<!--<span>
					${totalRecord}条数据&nbsp;共${totalPage}页
					</span>--->
					<#if totalRecord gt 0 >
						<@art.pagination currentPage=currentPage totalPage=totalPage url="${ctx}/article/articlesList?condition=${condition}">
						</@art.pagination>
					</#if>
				</div>
				
				
				
				<!-- Sidebar -->
				<aside class="col-sm-3 sidebar sidebar-right">
					<div class="row widget">
						<label>搜索文章</label>
						<form action="${ctx}/article/articlesList" method="post">
						<div class="input-group">
						    	<input type="text" name="condition" value='${condition}' placeholder="标题名" class="form-control" >
						    	<span class="input-group-btn">
							        <button class="btn btn-default" type="submit" style="padding-top: 9px;padding-bottom: 9px;"><i class="fa fa-search"></i></button>
							    </span>
					    </div><!-- /input-group -->
					    </form>
					</div>
					<div class="row widget">
						<div class="col-xs-12">
							<h4>侧栏描述一</h4>
							<p><img src="${ctx}/static/lib/assets/images/1.jpg" alt=""></p>
						</div>
					</div>
					<div class="row widget">
						<div class="col-xs-12">
							<h4>侧栏描述二</h4>
							<p><img src="${ctx}/static/lib/assets/images/2.jpg" alt=""></p>
							<p></p>
						</div>
					</div>
				</aside>
			</div>
		</div>	<!-- /container -->
	</div>
	<#include "/template/footer.ftl">
</body>
</html>

<script type="text/javascript">
	//function articlesList(pageNum) {
	//	var condition = $("#search_condition").val();
	//	var url = "${ctx}/article/articlesList?pageNum="+pageNum;
	//	if(condition != null && condition != "") {
	//		url +="&condition="+condition;
	//	}
	//	window.location.href=url;
	//}
</script>